import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/financeCustomerReceipt/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/financeCustomerReceipt/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/financeCustomerReceipt/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/financeCustomerReceipt/copy',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/financeCustomerReceipt/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/financeCustomerReceipt/import',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function enableOrDisable(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function print(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/print',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}
export function getMergeData(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/getMergeData',
    method: 'get',
    params: data
  }
  return request(obj)
}
export function merge(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/merge',
    method: 'post',
    data
  }
  return request(obj)
}
export function getJuniorDebt(data) {
  const obj = {
    url: '/api/basCustomer/juniorDebt',
    method: 'get',
    params: data
  }
  return request(obj)
}
export function receiptCollectPrint(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/receiptCollectPrint',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}

export function onlineRechargeQuery(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/onlineRechargeQuery',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}

export function refund(data) {
  const obj = {
    url: 'api/financeCustomerReceipt/recharge/refund',
    method: 'post',
    data
  }
  return request(obj)
}


export default { add, edit, copy, exportDe, importDe, del, passOrReject, enableOrDisable, print, receiptCollectPrint, getMergeData, merge }
